-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix return type of evaluate_at_grid_nodes #1044
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1044 +/- ##
=======================================
Coverage 93.69% 93.69%
=======================================
Files 39 39
Lines 6013 6013
=======================================
Hits 5634 5634
Misses 379 379 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -938,10 +938,10 @@ function _evaluate_at_grid_nodes(dh::DofHandler, u::AbstractVector{T}, fieldname | |||
# VTK output of solution field (or L2 projected scalar data) | |||
n_c = n_components(ip) | |||
vtk_dim = n_c == 2 ? 3 : n_c # VTK wants vectors padded to 3D | |||
data = fill(NaN * zero(T), vtk_dim, getnnodes(get_grid(dh))) | |||
data = fill(T(NaN) * zero(T), vtk_dim, getnnodes(get_grid(dh))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data = fill(T(NaN) * zero(T), vtk_dim, getnnodes(get_grid(dh))) | |
data = fill(T(NaN), vtk_dim, getnnodes(get_grid(dh))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I fix this consistently in this PR? Because other places use this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could do if you want to :)
Just noticed that this was not required after the changes here.
But it could depend on the resolution of the Int
discussion below...
@@ -649,7 +649,7 @@ function test_vtk_export() | |||
sdh_tri = SubDofHandler(dh, Set(2)) | |||
add!(sdh_tri, :u, ip_tri) | |||
close!(dh) | |||
u = collect(1:ndofs(dh)) | |||
u = collect(1.:ndofs(dh)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So Int types won't work after this? Perhaps you can use float(T)
when computing the type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue that integer types should not work here, because we assume that the solutions are in some continuous space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to proceed?
No description provided.